﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>CheckBoxTree</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link href="../demo.css" rel="stylesheet" type="text/css" />

    
    <script src="../../scripts/boot.js" type="text/javascript"></script>
    
    <script src="js/CheckModel.js" type="text/javascript"></script>

</head>
<body>
    <h1>CheckBoxTree</h1>      
    

    <ul id="tree2" class="mini-tree" url="../data/listTree.txt" style="width:200px;padding:5px;" 
        checkRecursive="false"
        showTreeIcon="true" textField="text" idField="id" parentField="pid" resultAsTree="false"  
        showCheckBox="true"   _checkOnTextClick="true"
        >
    </ul>
    
    <input type="button" value="checkNode" onclick="checkNode()"/>
    <input type="button" value="uncheckNode" onclick="uncheckNode()"/>

    <br />        
    <script type="text/javascript">

        mini.parse();
        var tree = mini.get("tree2");

        var checkModel = new CheckModel(tree);

        function checkNode() {
            var node = tree.getNode("base");
            
            checkModel.setNodeChecked(node, true);
        }

        function uncheckNode() {
            var node = tree.getNode("base");
            checkModel.setNodeChecked(node, false);
        }

    </script>

    <div class="description">
        <h3>Description</h3>
        <p>使用<a href="js/CheckModel.js" target="_blank">CheckModel.js</a>插件，可以扩展实现任意复杂度的树check逻辑功能。            
        </p>
    </div>
</body>
</html>